<!-- 
    //创建绘图上下文
    let path1 = new Path2D()
    //绘制或填充path
    ctx.stroke(path1);
    ctx.fill(path1);
 -->
 <html>

    <head>
        <title>Canvas tutorial</title>
        <script type="text/javascript">
            function draw() {
                var canvas = document.getElementById('canvas');
                if (canvas.getContext) {
                    var ctx = canvas.getContext('2d');
                    var p = new Path2D("M10 10 h 80 v 80 h -80 Z");
                    ctx.stroke(p);
                }
            }
        </script>
        <style type="text/css">
            canvas {
                border: 1px solid black;
            }
        </style>
    </head>
    
    <body onload="draw();">
        <canvas id="canvas" width="500" height="500"></canvas>
    </body>
    
    </html>